//
//  WSJShadowCell.m
//  ShadowCell
//
//  Created by wsj2015 on 16/7/25.
//  Copyright © 2016年 HF. All rights reserved.
//

#import "WSJShadowCell.h"
#import "Masonry.h"
#define screenW [UIScreen mainScreen].bounds.size.width

@interface WSJShadowCell ()

@property (nonatomic,  strong) UIView *shadowView;


@end

@implementation WSJShadowCell

- (UIView *)shadowView{
    if (!_shadowView) {
        _shadowView = [UIView new];
                _shadowView.backgroundColor =[UIColor whiteColor];
        _shadowView.layer.shadowOffset = CGSizeMake(1,1);
        _shadowView.layer.shadowOpacity = 0.3;
        _shadowView.layer.shadowColor = [UIColor blackColor].CGColor;
        
    }
    return _shadowView;
}

- (void)awakeFromNib {
   
    [self insertSubview:self.shadowView atIndex:0];
    [_shadowView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).with.offset(5);
        make.left.equalTo(self).with.offset(0);
        make.bottom.equalTo(self).with.offset(0);
        make.right.equalTo(self).with.offset(0);
    }];
    
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self =[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
          [self insertSubview:self.shadowView atIndex:0];
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}



@end
